<script setup>
import { useRouter, useRoute } from 'vue-router'
const router = useRouter()
const route = useRoute()

</script>

<template>
  <el-container>
    <el-header style="display: flex; align-items: center;">
      <a href="/index.html" target="balnk">
        <img src="./assets/logo.png" style="width: 50px; margin-right: 20px;" alt />
        </a>
      
      <h1>易千图书馆管理面板</h1>
    </el-header>
    <el-container>
      <el-aside width="200px">
        <el-menu
          active-text-color="#ffd04b"
          background-color="#2f4056"
          :default-active="route.path"
          text-color="#fff"
          :router="true"
        >
          <el-menu-item index="/home">
            <el-icon>
              <user />
            </el-icon>
            <span>个人中心</span>
          </el-menu-item>
          <el-menu-item index="/users">
            <el-icon>
              <user-filled />
            </el-icon>
            <span>用户管理</span>
          </el-menu-item>
          <el-menu-item index="/books">
            <el-icon>
              <document />
            </el-icon>
            <span>图书管理</span>
          </el-menu-item>
          <el-menu-item index="/records">
            <el-icon>
              <setting />
            </el-icon>
            <span>借阅记录管理</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<style>
*:focus {
  outline: none;
}

html,
body {
  margin: 0;
  height: 100%;
}

#app,
.el-container,
.el-menu {
  height: 100%;
}

.el-header {
  background: #243346;
  color: #fff;
  border-bottom: 1px solid #4b5461;
}

.el-main {
  background: #f0f2f5;
}
</style>
